<?php
namespace app\admin\validate;
use yzh52521\validate\Validate;

class MembeValidate extends validate{

	/**
	 *@description 验证器规则
	 *@buildcode(true)
	*/
	protected $rule = [
		'username'=>['require'],
		'mobile'=>['require','unique:membe'],
		'email'=>['require','unique:membe'],
		'amount'=>['regex'=>'/(^[1-9]([0-9]+)?(\.[0-9]{1,2})?$)|(^(0){1}$)|(^[0-9]\.[0-9]([0-9])?$)/'],
	];

	/**
	 *@description 错误提示
	 *@buildcode(true)
	*/
	protected $message = [
		'username.require'=>'用户名不能为空',
		'mobile.require'=>'手机号不能为空',
		'mobile.unique'=>'手机号已经存在',
		'email.require'=>'邮箱不能为空',
		'email.unique'=>'邮箱已经存在',
		'amount.regex'=>'积分格式错误',
	];

	/**
	 *@description 验证场景
	 *@buildcode(true)
	*/
	protected $scene  = [
		'add'=>['username','mobile','email','amount'],
		'update'=>['username','mobile','email','amount'],
	];



}